package com.slowfly.rule.engine.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum FeatureTypeEnum {

    NUMBER(1, "数值"),
    STRING(2, "字符串"),
    BOOLEAN(3, "布尔值");

    private final Integer code;
    private final String name;

    public static String getNameByCode(Integer code) {
        for (FeatureTypeEnum strategyStatusEnum : FeatureTypeEnum.values()) {
            if (Objects.equals(strategyStatusEnum.code, code)) {
                return strategyStatusEnum.name;
            }
        }
        return null;
    }
}
